package inet.app.vod.activity.search;

import android.content.Context;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

public class SearchPagerAdapter extends FragmentPagerAdapter {
	
	FragmentManager mFragmentManager;
	Context mContext;
	Fragment[] mFragments;
	
	public SearchPagerAdapter(Context context, FragmentManager fm) {
		super(fm);
		this.mFragmentManager = fm;
		this.mContext = context;
	}
	
	public SearchPagerAdapter(Context context, FragmentManager fm, Fragment[] fragments) {
		super(fm);
		this.mFragmentManager = fm;
		this.mContext = context;
		this.mFragments = fragments;
	}

	@Override
	public Fragment getItem(int position) {
		if(mFragments != null) {
			return mFragments[position];
		}
		return null;
	}

	@Override
	public int getCount() {
		if(mFragments != null) {
			return mFragments.length;
		}
		return 0;
	}
}